Update usage of fromimage/toimage functions.
Add functions to tile/untile an image array.
Add convenience functions to construct models, parameters, and states.
Use "ml" model by default, and resize input images (avoid errors on small images).
Fix bugs in ImprintKernels, as well as model.SamplePatches and PatchGenerator.
Improve conversion between images and model layer data.
Fix bugs in BaseState when using LayerSpec as dictionary key.