Addressed many TODOs. Some tested. Some untested.