Chemical precipitation for controlling nitrogen loss during composting