Reworked and simplified event system. Added interfaces module. Added virtual machine for code execution.
Merged upstream.