Support calling optimize with integer inputs

This also does sensible stuff when the user passes mixed-type inputs
for lower and upper.

This is not perfect, in that it limits it to FloatingPoint
numbers; really we should be using traits and support anything
for which `eps` is defined. But that's a bigger change.

Fixes issue reported here:
https://groups.google.com/d/msg/julia-users/Yg73FxKDNzY/2c86vJ5N4zYJ