add some basic testing for headless.Main

review/merge by @frankduncan plz