Rewrite ex module so that new commands are easily added.