Clean up after views in tests
Clean up unused/duplicate code
Prevent overwrite on view registration

See #1553