fixes #50 and some other typos etc. (and remaining references to this after a refactoring where 'this' got replaced by a scope variable.
This also imlements what is sugested in #52 but we don't have a test to verify this atm.
Adds locals as a preserved parameter to view refreshes as sugested by #49