Modular items: Add code for getting and setting the active module.

Not actually used yet, and thus untested.
Fix some derps and NPEs that showed up when testing on SMP for the first time.