Fixed sharing tests and general improvements.
Added infrastructure for emsemble testing. Added a basic ensemble test. Fixed a few minor potential issues.