optimized write objects, changed create to take either a PailSpec or PailStructure.