Simplify java <-> c string conversion on os x.
Some updates to windows version detection.