Implement issue #23, and clean up preferences page