I am not sure if going by public transportations is the fastest way eventhough I did consider it.
This
NJTransit-planner gives me a travel time from JFK to Somerville from about 2h40min (subway A from JFK). As far as I know I "save" 20min going by Airlink/LIRR; given myself the chance to buy a ticket at Penn Station IŽll thought there has to be faster way than being 2.5 hours on the way.