Added karma & grunt configs
Improved code coverage
Fixed some string unescape bugs