upgrade to work with GHC-7.8

Fix so that it works with GHC-7.8.
Changes:
- GHC.TypeLits has changed quite a bit (SingI no longer exists)
- unsafePerformIO has been moved to System.IO.Unsafe

Note that I'm not entirely sure of the fix in LC_C_Convert but it seems to work.