enum.js code moved from the whalepath-server code.