Started to add ERT tests, and move functions out of temp.el.