code clean up to fix broken unit tests and grunt build