Fixes and tweaks

* Worked towards making 'Scope' a class
* Added naming of non-member functions
* Other stuff