Depreciated functions removed

Was using table.foreach, this is depreciated. Changed to for k,v in
pairs()
Optimised Loops

Optimised and removed some useless loops
Added UserPerms fixes #1

Added user permissions to the player setup