Introduced profile ratio, refactoring, small optimizations, merged hg repository, added benchmark scripts