These changes do not change the behaviour of the code and should be non-controversial.
* refactored out build to lib * save_raw returns * fix indentations and other small fixes * fix build API * rename Target to SourceTarget * fix formatting * make join runtime_type into runtime_type and runtime_version