Adding login_required_ajax function to views

And redirect from the js uppon AJAX call of non authenticated users.

Fix #50.