v0.1

Copy of research code.  To be clarified later and polished.