Added ReadAtMost function for reading request data (refs #2292)

ReadAtMost will read up to the specified number of bytes, returning
an error if the request is larger than that limit.
Merge branch 'master' into 2449-keep-write-blocks
Code review comments (refs #2292)
Clean up error handling (refs #2292).
Merge branch 'master' into 2449-keep-write-blocks
Merge branch 'master' into 2449-keep-write-blocks
Merge branch '2449-keep-write-blocks'

Closes #2449, closes #2292, closes #2507.