Implement flexible target specification

See commit message.
This shouldn't explicitly throw away all the error information and may be clearer when using the `try!` macro