Fix for #216

This is mostly a fix for #216, though a few other things changed. It has a parser for the commands. and some more documentation.