Global memory handling update

Switched some large arrays from local (defined in a function) to global
memory allocation. This avoids re-/deallocating memory during
simulation which is a slow process.
Apply k-space cutoff directly in Ewald

Previously the given k-cutoff radius was only used for determining the
k-summation cutoffs for Ewald, which decide how many times the sum goes
over shifted periodic images of the reciprocal cell. However, there is
really no need to calculate the structure factors for all k in that
region - which has a rectangular shape (or in general triclinic) - in
fact it makes more sense to use a spherical cutoff. Now the summation
over k is also truncated according to the absolute length of k to save
calculating all the structure factors.

Also a function for guessing Ewald parameters was included and a bug in
initializing the parameters upon creating a CoulombSummation was fixed.
Ewald combined with real space sum of potentials

The ewald summation is now done along with the rest of the real space
summation of potentials to avoid looping over neighbors twice. It is
possible to do the real space sum also along with the reciprocal sum in
the ewald subroutines, but when called from the force and energy
calculation routines, this is avoided.

Also fixed bugs that would lead to segmentation faults when a
calculation was run without any potentials. This was due to some arrays
being initialized only when potentials were being created.
Severe bug fix in triplet finding

There was a bug in the algorithm that searches for local triplets. In
one location, index j was used when fetching pbc_offsets when index l
was actually needed. One letter index error!