-fixed a bug in rex I think I introduced.
-added unit test for rex (native rex, not incl pkg commands)