Fixed undefined sleep function on Windows
Fixed script to support automated setup on Windows

Used winreg module to locate matlab directories from the registry.
Tested on MATLAB 2012a.