New application architecture

Closes issue #2, #3, #5, #6 and #7