Significantly generalized training data generator; added argparse