add preferences

Adds the preferences plugin and a simple API wrapper for it (which won't
work yet because the API core hasn't been completed)