Introduced fixPermissions() and console arguments
run script with -h for help
rename user_id to userId
introduced perm.update()