These end up being defined in global scope. If we're going to use this as a standalone .js file, maybe wrap it in an immediate-invoked function expression?