finished adding nearly all rigorous docs and tests, while shrinking codebase.