Add profiling, fixes #21