Change code to not need listeners in frontend.js, and switch relay