fix signup form: id dup detection bug

see HIVE-144
+ some cleanup action
test: divide case and add suitable tests