Fixed a couple of issues with AOP system

Also cleaned up some stuff from the framework side of things.
Uploaded new beta version for 4.0