Restructured JS code into lib, client and server directories
Basic access controls and subscriptions