Fixed get_partial raising an error

get_partial would throw an error when no partial was found.
Now it just returns an empty StringIO (and thus an empty partial).
get_key now defaults to ''

Instead of return None, get_key now returns an empty string.

Also wrapped get_key calls in str
Fixed IndexError on scopes

If there are no scopes it defaults to None