Refactors location of profiling code.
Merge pull request #16 from larsssono/master

Refactoring and spellling correction