Make the library loading platform independent

Should make it work on Windows, OS X and Linux. Currently it assumes a 64 bit platform for everyone, however, so detection needs to be added for that.