Environmental and biological controls of bivalve shell mineralogy and microstructure