Moving selectional preference popup code from Slowal project. Making some adjustments to database models and API.