Combine binary "get" and "touch" handlers

There was a ton of code duplication in these two request handlers; they
do basically the same thing so are cleaner as one function with a few
extra conditionals.