Revert "Revert "Add miniprofiler. Fixes #151""

This reverts commit 7ae22e769b186ac483ab88341bbe8cbe9bfb0533.