Re-wrote unit tests in coffee script and fixed bunch of errors