Test that NLFile throws exception if the file is too big

Also improve testability of NLFile.