Localize 'no strict qw(refs)' where possible.

Move more constants (max userbytes, thread state constants, etc.) to
symbolic constants.

Flipped some conditionals around to not use '[statement] if [conditional]'
structure, since PBP discourages it.