Cleaned up the code a little, added authentication requirements for certain commands.