replace dependency on external libdl
fix more test cases for win32
more workarounds for inttypes
revert several changes to the build process
support RTLD_NODELETE, check return value of LoadLibrary