cleanups in neuralnets

Replaced the raw pointers used in neuralnets with SGVector/SGMatrix