Initial import from after extraction from sourceforge and refactoring