Magnetohydrodynamic simulations of compact stars and binaries in full general relativity