Refactor chatroom application to use angularJS. Properly update users and messages arrays upon socket events