A little cleanup
Add comments, move support into main lib.