Performance improvement, preallocate functions.

Preallocated lammps and pypar functions to reduce function lookups.