Refactor for mikemacs (in progress)

Breaking commit, do not use.