move stuff out of stocks.py into common.py, will probably support plugins later