Add `-O3` and `-threaded` were it's sensible

This just turns on GHC optimizations.