Encapsulate generated Javascript tests. Fixed #20