Structural, Electronic and Switching Properties of Metalloporphyrin Molecules on Metal Surfaces