Increase checksum noting and matching for imports. (rebase)

To test make sure that different import/upload paths still work, including attaching files as annotations. For real files in the server's local filesystem, if they have a corresponding entry in the `originalfile` table in the DB then make sure that the SHA1 there is set correctly.

The rebase of #890 clashed poorly with refactoring on develop. In `ManagedImportProcessI.java` mostly it just adjusts the style of the code to more closely fit what is on dev_4_4.