Make RuleBuilder.Build take a subset of ModuleContext and
SingletonContext, and dynamically call PathForModuleOut only
if it is available.
Test: rule_builder_test.go
Change-Id: Id825cb75236acf187e9d4a36353a47abcac71927
Move dexpreopt.Script to android.RuleBuilder so that the builder
style can be used in more places. Also add tests for it.
Test: rule_builder_test.go
Change-Id: I92a963bd112bf033b08899e930094b908acfcdfd