Added lua script support

Heavily improved multithreading (i.e. object update is now done multithreaded)
fixed bugs in Scheduler
Improved memory management
Minor changes in log class