refactor aatopology.h to deal with periodic bounds

RigidFragment now accepts another paramter

std::shared_ptr<DistanceInterface> distance_function

Both CartesianDistanceWrapper and PeriodicDistanceWrapper inherit from
DistanceInterface, so either of those can be used as the distance
function.

I could have done it by templating RigidFragment, which would have been
faster, but the code ends up simpler using interfaces.  The distance
function is called over and over again, so the loss of speed may end up
being a problem.  I think it will be fine, but we should user profiling
to test for sure.
fix bug where array_wrap_np was ignoring exceptions

I forgot to add except * to the end of the cdef function.  This is
needed because the cdef function returns a pure c object.
add periodic distances to _cpp_aa.pyx