Switch from strings to constants (overdue), and little cleanups.
wip