Tests now use mocha, fixed errors tests revealed