Ensure presence of runtime in function's environment

* src/pf/bpf.lua: Ensure runtime functions are in function's
  environment.
Fix expander and optimizer bugs

* src/pf/expand.lua: Fix portrange expansion, and fix conditional
  inversion.