Replaced old access levels with new permissions

- Fixed a couple bugs with permissions
- Rewrote login_required() to use permissions
- Changed login procedure to look up and store permissions