Mayor refactoring. Also removed unnecessary ListPreference duplicate.

ListPreference is part of the Input Access Library. It is best to include this library as a dependency instead of copying a single component as it was done previously for the preferences activity.