Use Config instead of globals, part 1

This only convers core config options, not ones provided
by the extension.

Change-Id: Ife1effd054e99f609e287c2ac9c935c28e88c476