Added file I/O to be able to add hedges from text files. Also significant refactoring.