Support ad hoc module snippets as InMemoryFile

Allows ad hoc script sources to be registered via the InMemoryFile shim.