Replace more PrintToServer calls with LogMessage in module manager.
Improve error handling in module manager.

ThrowNativeError doesn't stop the execution, so we must leave the function manually on errors.