Converted from https://bitbucket.org/jnoller/pyjavaproperties/ +  some patches from https://bitbucket.org/evgeni/pyjavaproperties