Unittest mock commands

I moved the mocking to the external boundary of pynag. Writing to the command file is mocked at the command file.open() level and livestatus is mocked at the livestatus socket level.