Minor refactoring to rest test, implement functional tests... that are WIP due to bugs with process lib