Proper implementation of extractvalue instruction

Fixes #156.