Make fundy work again

Hi, I've made fundy compile and mostly work again based on my own efforts and borrowed bits from [mio](https://bitbucket.org/miolang/mio)