VisualEditor.php: Re-order and clean up

Match the conventional layout for this file.

Change-Id: Ic437c1a9423af47a3a1f3068afec6daa4ba7eefc