Minor refactorings
Implemented Django internal permission framework. Closes #6