Refactored PlayerStateManager to include world enter and exit hooks. Simplified hook handling.