Avoid 12 sprintf calls per insert
Call getpid directly instead of get_sv("$")
Eliminate repeated and costant strlen() calls
Avoid looking up global variables again and again
Look up relevant globals at API entry points

The previous commit broke using 'local' on the global variables, since
that replaces the symbol table entry with a new SV temporarily.
Merge pull request #66 from ilmari/speedup

Speedups