Allow update of users, add cache update functionality for sessions and users

This patch allows:
- Admins (currently) to change username, password, and role of users
- Sessions and users to be updated by their session ID and user ID respectively in a dictionary
- Fixes cookie logic which was causing session problems with REST urls (`/api/users` vs `/api/users/1`)