wait implementation for cross-compile (previously was a no-op)
system rest happens now after response is sent and flushed.
read value can now take a 0 as the expected length which means not known.
fixes to system profile to make tests pass. profile start/end locations were not computed correctly.