Factor out 'is request asking for json?' into route helper
Use updated-for-Sinatra-1.4 method of testing accept header.

Cannot use request.accept?() because many browser requests
automatically include */* which causes that method to
return true.
Whitespace, hooray
Merge pull request #159 from bitprophet/better-api-request-detection

Better api request detection