Cleaned up a bit and wrote documentation
Added namespace resolution to function bodies, cleaned up some stuff