More python 3.x fixes:

  * allow numpy array as an argument to hash_from_code.
  * use truediv instead of div under 3.x.
  * **kwds checks that keys are strings in 3.x
  * fixed a typo bug in tensor/opt.py
  * fixed an incorrect numpy version check in test_basic