Add modifyRef that returns a pure value

This is equivalent to the atomicModifyIORef from Haskell
Back out dependency on tuples
Whoops, forgot to update FFI code from tuples
Merge pull request #2 from MichaelXavier/modify-return

Add modifyRef that returns a pure value