Decoder checkpoint.
Fixed errors when generating dist file.  Added more inline docs.  Improved code style in a few places.