login_required decorator and some tests closes #20