Many more functions; Haddocks; better structure.