Move Chain implementation to chain.rs

Created by  David Tolnay  on November 17, 2019
XPE6XANXV2TTPCF7BO5RNYGAZVHA3OKDFETBOWVGG7TVRCLRKAEQC
Change contents