Small tidying up.
Added environment checkpoint to test setup. Changed assert to expect. And added some tests for 'while' loops.