In elemwise.perform, make sure numpy ufuncs do not compute in float16

Since many elemwise ops do not call the scalar op's impl() method,
we needed to also change the perform method when numpy built-in
ufuncs are used.
Add helper functions for specifying the "expected" values

Otherwise, the expected values could be computed in float16,
which would not be precise enough, and which would not be supported
as a dtype by Theano.
Add int8 values in elemwise tests.

Also:
- add tests for "inv" op
- do not test inplace if the input is int and the output is float
- remove a couple of redundant dicts