Miscellaneous cleanup and commenting.
Added serial mode; try to guess when it will be needed.