Fixed win32 port. Added MCMainThread implementation