exit with code, support for loop and continue

Change-Id: I033679c85d2e4dcd1c83c1c5ff905f52c901756a