Changed CommandProcessor into static class

To emphasize that it has no state.
Move common functions into classes/util.php