A fundamental theorem of homomorphisms for semirings