Magnetic and electronic structure of the nitrides PdFe3N and MnFe3N