Refactored autcompletion to remove dependency on GhcModi and improve performance.