New architecture

Merge the new-architecture back to the master branch