Logging support

Now optionally logs to a user-defined file, including timestamps and source URLs for files