Make things a little less brittle

Upon a first install things will break pretty crappily. This gets it a
little more defensive and checks the state of some external dependencies
before running them.