Redesigned permissions system, added commands

The permissions system now keeps history of every change in permissions
so that relevant permissions that were configured can be applied to any
command at any time, regardless of their time of insertion.