Updated source files to latest v3.1.x versions (where not updated for v4.0) and updated license URLs