Cleaned up nimcheck core logic (modularized it mainly)

Added an 'external file check' command, which checks external, unopened files.