Initial rewrite. Bumped version to 1.9.9