Convert gmx-insert-molecules into proper C++ module

This makes the module a bit more exception-safe (but not perfectly),
removes remaining legacyheaders/ dependencies from the code, and
demonstrates how the new helper class works (and acts as a
proof-of-concept for that generic code).

This new approach also makes it easier to start using selections in the
tool, but that is a potential future improvement.

Change-Id: I0bad97ff7638f9f583a096f212c070c0e34af1a2