Code cleanup and performance
Merge pull request #12 from buttercoin/bm_perf

Code cleanup and performance