view scopes

See #331 

This should't change anything from the API point of view, but it should solve all bugs related to view scope.

Feedback welcome !

There are a lot of unrelated small changes along the way :)