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.
Yes, that's correct. If you could figure out how to mark this as deprecated, and raise the deprecation at the appropriate version level, (0.7/0.8) then that might be ok. You would need to implement both deprecated and new methods, however.