[POC][4.0] Internal refactoring + new api for transformations

Relating to #557, I've spent some time just mucking around with code to see what it might look like.

There is a commit in here about deprecating some top level classes that will make it into 3.0 but I'd like to see if people have any comments about what I've done here. The second commit has all the changes relating to the internal refactoring/new api.