first working copy,
still lots of rough edges, but the core functionality is alive :)