Implement permissions system

Add control over who can query what, and who is immune from query.
Merge pull request #1 from bezeek/master

Implement permissions system