Add folders to backend

This is a branch that has been long running.
It was reviewed by @philschatz - I have attended to many of his concerns raised (however that thread seems to have vanished from github - I may simply be being stupid there)

I would like to pull the darn thing in, it runs and meets tests, and is definitely causing pain to those who want to branch of master.