Add TODOs, clean up, clarify comments, and add one more test.