Added module name on compile error.

Also split out compile-file function.