Replcommands

I tried merging latest `dev` into the existing `replcommands` branch but it ended up in a massive merge commit and it was just too difficult to work with WRT diff'ing the history etc. so I went back to the original branch, rebased it, and cherry picked the three post-merge commits (ignoring the last commit which introduced the Arguments class).

This branch is now a straight line of commits from dev.

The syntax changes that came out of our discussions have now been implemented.

closes #224
closes #237
closes #583 

replaces #612