Electronic Structure and Dynamics for Molecules Near Metal Surfaces