Integrate front ends and back ends

- replace all the Demo* stuff with real ones
- a few database services cleanup
- refactor code
- Most functionality is now working.