Merge pull request #13 from mezis/fixes

Adds benchmarking, strengthens tests, fixes a few memory issues
Merge branch 'master' into fixes