Made expand/contract consistent, even with "clear" operation.
Moved experiments out of main haskell impl.