Self-consistency, spin-orbit and other advances in the FDMNES code to simulate XANES and RXD experiments