Removed onUnload from corelib and added more lua bindings for resources.