MULTIMODE: A code to calculate rovibrational energies of polyatomic molecules