Abstracting permissions out to their own namespace. Will allow people to put in their own custom permissions algorithms.

Signed-off-by: Ben Corlett <bencorlett@me.com>