updates and fixes, to ensure it can run on windows, and from either rails or from the bin directory