MAINT: use ndarray for gradient

Drop custom functions PyObject_AsDouble() and PyList_IntoDoubleArray().
TST: separate tests of optimize and tnc (moved to test_tnc.py)
FIX: use PyArray_SimpleNew and memcpy instead of PyArray_SimpleNewFromData in tnc
FIX: don't use PyArray_Type in ParseTuple in tnc
FIX: check the return of PyArray_FROM_OTF in optimize/tnc

To detect invalid types in particular.
FIX: eliminate asarray in tnc python code

Rely on C code for type check and casts
STY: drop docstrings from test_tnc; PEP8