History history in javascript

switched the history branch over to javascript, and added new tests in.