Add test support, partial code documentation, partial test coverage.