Refactor cabal configuration

Fix all issues created in the process.