Fixed forgot password dialog, reorganized js