postaljs restructuring for standard/amd