Fixed issues on sync stuff. Added unit tests. Improved Grunt