Fixed some errors in parsing system.

Previously, inputs like this:

log(2x)

would result in the calling of the std::abort() command, terminating
the application. However, by iterating through the string and checking
for expressions like 2x, they can be replaced by 2*x before things are
exacerbated any further. So now, inputs like 3x^2 and 3x are converted
so that everything seamlessly works for the user :)