Some work done

Finished a handful of functions. Work is very sloppy but passable. Will
put in more effort on functions where we are evaluated on performance.
Will finish more later.