#16 Move config merging code into new object