[lib] Added config file read/write support. Stubs for other functionality.
[examples] Updated register-new-key example to use new API.