catch more yaml errors

when the input is a pure string, yaml.load() returns the string
instead of a dict.  Consider this an error an raise TypeError
in the client