Pab/obuild fixes

Same set of stuff, with a bit of 32/64 bit care (I added a macro to compile out 64 bit code).  Some small 
renamings and additional comments too.