Refactor knowledge of stocks out of couchexport