Fixed the read and write callback types. This makes them more usable in strict_types mode. Since the types are now so long they use a typedef.