Replaced socket.select with non-blocking .receive as it is faster.
Fixed resetting cached source as it may change when basedir changes.
Fixed terminating debugging of an empty script.
Improved debugging performance.
Added handling of case-insensitive filenames on OSX.