JMRI refactor

Major rewrite of JMRI handling code.