huge refactoring; create app scope; fixes for devise behaviour; ...