Registration functionality now works (though needs more thorough testing).