Improve test teardown

Hi Ashton,

I have learned this little trick for ensure some code run after the function complete (or fails), I think it's good to avoid endpoint colisions when tests fail.

```matlab
cleanupObj = onCleanup(cleanupFun)
```