Pruning and fine-tuning.

Added the rest of the permissions I want to add right now, as well as
adding some checks to facilitate flags.