Scope operator and namespacing

Lots of changes to accommodate namespaces and scoping of types and functions.  Probably still has a bunch of bugs in it, but lots of tests were added to confirm at least a few simple cases work.
Merge branch 'feature/namespace-improvements'