CSRF protection

Add preventive protection from CSRF attack type. Check http_referer and
system of generation anti-csrf tokens for forms action.