de-spaghettify and clean up cvode interface, remove dependencies, fix potential issues