Fix broken use of =cut

It's only needed to end a chunk of =pod before some code
Remove some tabs which made it hard to see indentation
Don't check for html to see if the server returned an error, check content type

If the server didn't return JSON it's some sort of error, but we should not
assume that it's HTML. Sauce Labs just returns a simple text message. The code
as it was previously would look for <html>, not find it, and then blow up when
it tried to treat the text message as JSON.
Include the error message from the server when we can't create a session
Don't assume that a response has any particular structure

This avoids some undef warnings
Move cmd_return check up a little higher to simplify the code
Merge pull request #55 from autarch/autarch/handle-non-json-response

mostly changes to make the code a little more robust when handling errors.