Significant refactor of low-level functionality.

To reduce duplicatation of code, and improve the design
methods that were previously on the Build object, have
now been moved to the BuildProtocol class.

Secondly, rules are now instantiated during the build,
rather than mostly treating them as singletons as was
previously the case. These two changes combine to reduce
the amount of unnecessary parameter passing.

There is scope for further improvement along these lines.