made it load files not name in json config
added in conditional functionality to config json

... as well as some more error handling.
merged from master