Merge "Move the listener code into its own file."