Closes #348. Webapp refactorization