Implement flexible target specification

See commit message.
Can't expand into multiple statements, and macro-defining-macros don't really work, so I don't see how to do this.