3.1 code refactor

Replacing lots of old 2.4 deprecated code with new 3.1 compatible code.

Will require peer review and also aware that we could take this further... for now it's just what I could find and repair.

Most issues were around the ORM style and the use of Config system vs statics.

Locally all previous tests are passing and a quick smoke tests playing around in the forum and posting some stuff seems to work as expected. More testing would be great though.
I did a bit of work getting UploadField working on the front end, but there are a few considerations (mostly security). Check the docs http://doc.silverstripe.org/framework/en/reference/uploadfield#using-the-uploadfield-in-a-frontend-form