Fixed: Removed orphan array_merge().
Refactored: Socket messages to consist of "type" and "payload".