beta v0.9.1 code

imported from old SVN repo