Massive refractoring

Separates views and authorisation
Centralizes test

Fixes #30