Implemented backend for preferences. Added UI support for Profiles