Move custom code from aj to java (Part 2). Fix the setup user page.