Refactor PUG and clean up PubChem interface