bug fixes for javascript, added prototype for exceptions, test index.html file