Added macros to extract structs from Ruby objects.

This makes for a hell of a lot less repetition.