started refactoring TogetherJS code into opt-frontend-common.js