IM3: fix memoization and whitespace

Most of the diff is concerned with removing tabs and trailing whitespace.  The two things to check are code changes in caf5937, and to verify that builds (particularly 5.1-merge-full-repository) remain green.  Automated testing for .im3 files is now turned on, so memo file tests should pass.