Add build variant and per-rule env specification

This change lets you specify the build variant of rules.  Note that
rules of the same package do not have to be built for the same variant.

Since it is common that every variant has its own environment, this
change also lets you specify per-rule build environment (you could only
specify per-package build environment before this change).