math.hpp: some minor cleanup, doc fixes and todo items.