bin/compile: Simplify and refactor

Also simplify bin/prepare by not trying to do variable substitution,
since all we really want at that point are the list of BuildRequires.