Make builtin commands more object oriented

I hestitate to use a factory, but so far this makes the code cleaner.  Will
think about ways that I could avoid this, but I like it so far.