fix keyNew examples

improve keyNew to work with size_t (use own variable to flag that is
changed and do not use -1 behaviour)
some more examples + tests
add mingw support

finally refactor code to search for utilities (was duplicated)
fix testcase (was documented that way)