cleanup finished, except tests
import some functions into top-level namespace, fix up the docs