Memory allocation improvements

Also made sure events and output functions always get a column vector.

Signed-off-by: Andrew D. Horchler <adh9@case.edu>