Commiting current work on layerwise trainer in preparation for adding some new features