Refactor. Add benchmarks and grunt.