refactor to use params for twojs obj construction
make module independent of app
cleanup and comments