Use 'with' block to open discovery file; updated docs