Implement preference page, and update code to use that