Refactor config handling to add in-memory config structure

Read the config into a linked list before writing it. This allows the code for
device read/write to have a single implementation shared between .xcfg and
OBP_RAW code.