rearranged to have no circular imports
changed imports into non-from form
changed more imports into non-from form
more docstrings
more imports into non-from form