add missing semicolons
removed insecure mode, added allow/deny rules for collections
removed autopublish mode, addes publish/subscribe methods
reformatted JS code (indention)