add implementations of a bunch of basic IR functions

IMPLEMENT ALL THE THINGS!! Only compiled tested, aka not tested at
all...