lots of porting work to latest build of rust. WIP