Refactor and update Haddock usage
Change compilation to work with unsaved files