refactoring to be more idiomatic python, adding crude tests, bumping version to 0.2