Added logging, command formatting, more tests