Moved game code to the dll.

Corrected an issue with shared_mutex usage on write operations in the event dispatcher