Add simple testing script for gd_stoch
Various bug fixes