use the _template preprocessor in other placese too
create separate register subroutine
update the pop-up registration form to use the json back-end for registration