Tidied up documentation; added GNU GPL header to many files.