Revised `core.Molecule` for correctness and maintainability.

* Propagated the changes to other classes, as needed.