Remove PhysicsManager singleton and use shared_ptr instead.

Resolves the issue where sometimes destructors were called in an unexpected sequence resulting in a crash while exiting the application.