Refactor profiler code

Code review fixes

Refactor of profiler, and moved tests around

Fix doc

Added a profile collector to accumulate the profilers per stage

Remove unused method
Merge pull request #23 from Shopify/profile-refactor

Refactor profiler code