Refactored sample runner and cleaned up the tests and commands.