timeToFirstByte: fix race condition

* fixes #298 
 move timeToFirstByte to a separate core module