Initial commit of preferences handling