update dependencies, add tests, move non-webapp code to dedicated file