start of javascript and tests
first pass at javascript with functionality and passing tests