amended tests to handle the ajax request and still make them pass.
added some refactoring, and the views for devise.