Implement flexible target specification

See commit message.
It's pretty annoying to use `try` since there are three separate error types: `json::ParserError`, `IoError`, and whatever comes out of `Decodable`.