Various changes and fixes.
Added example config.json for testing purposes.