RE-factor

Fixed a bunch of stuff, made it work (hopefully) and now it takes
advantage of a bunch of c3 functionality

aaaand, the code is actualy readable now!