Single ifdef implementation switching

This is a huge commit! I've added libraries, and all sorts of neato
things.