Implemented an initial model for #22, as part of #4. Tested on the command line.