Handle non-existent/wrong-format files, clean up.

Fix exception handling for when a file does exist or when a file does not
contain a valid JSON object.

Clean up doc-strings

Add copyright and licence info.