Implement flexible target specification

See commit message.
Could you explicitly state that most fields are optional?