Remove unnecessary msg checks, add handlers for addedBefore and movedBefore messages. This should probably be refactored later.