Use keys, values, items instead of the iter* equivalents.

iteritems was replaced with items in python 3.  The memory overhead of
using items in python 2 should be minimal.  (Similarly for iterkeys and
itervalues.)
Use print_out instead of print in test input file.
Python 3 returns float when dividing integers and we want an integer.
Use print(...) for compatibility with python 2 and 3.
Further python 3 compatibility work.

Range in python 3 returns a range object instead of a list.  Add an
explicit list call to allow symbols to be modified.
basestring is str in python 3 (as set in many other modules).
Unlike python2, python3 can't compare None and an integer.
Avoid maximum recursion limits when copying LibmintsMolecule.

Not quite sure why this wasn't triggered by python 2, but is_variable
(which was called from __getattr__) triggered a __getattr__ call,
resulting in an infinite loop and thus hitting recursion limits.