Modified core ODE function for speed.

Removed all ifelse statements. Soon can move to
vectorization of most of equations.