Add exception throwing to loadLibrary

Closes #112
Merge pull request #166 from Xandaros/libException

Add exception throwing to loadLibrary