GWT-150: javascript impl and example

GWT-152: implement javascript api (initial implementation, not fully
checked yet)