refactor from single script into pip module
remove build dirs
rewrite and refactor reference documentation