Working commit api. (With testcases!)
Some misc admin cleanup too