refactor/simplification and bug fixes

-renamed some classes
-made base and parent classes available at compile time
-factored out common code for scope parsing