Initial import
fixed a couple of minor things - still doesn't compile (casting of
function pointers ):