Added events library to unify event handling.
Moved string metatable protection to bios.
Minor bug fixes.