add jasmine testing and clean up console logs in javascript