JS-generaton 2/3 implemented

Wrote some code for the JS-generation, fixed some bugs