close the tmpfile when done..
use constants
move check_user_token() to util

for testability..
make argv const to get rid of warning
add test for check_user_token()