Add profiler support

Closes #142