Make the cogbin a sphinx extension, style it and update build script