Factor out user interaction/controls into interaction.js.