Theoretical analysis of bonding in monomeric and polymeric C5H5M compounds