genlib/cordic: cleanup, documentation, unittests