adds man page
copy paste put impl into headers; duh? moved back to cc plus moves most impl code into lib