Tidy up and clean up quote API, closes #814