Database views

Solves #14, #15.