added new stock utility code, exports entire table or queried records to csv