Replace MVar with IORef and MVar lock
Fix export and syntax
Merge pull request #55 from FelixVanderJeugt/master

Replace MVar with IORef and MVar lock