Webapp big refactor

#348
To add documentation