Added support for selecting the layer class for the sparse block model from the command line.
Re-organized some of the code.
Started adding support for a new type of sparse layer.