Added Atoms class to clean up Atom-array-handling code.