Re-arranged inheritance to be more sensible, also made BUILD_TIMESTAMP
and REVISION available for JS calls too.