Big code cleanup and version bump to 0.1.4dev