initial migration to serpent and updated tests