Adds documentation.

Step 1 towards Issue #4.
Throws an error if invalid JSON or dictionary.