Remove almost all of branch.java, fix login dialog