Inital commit. Core of library coarsely tested.