[SPARK-4358][SQL] Let BigDecimal do checking type compatibility and use more specified numeric types 

Remove hardcoding max and min values for types. Let BigDecimal do checking type compatibility.
`start` and `length` are used as the parameters to call `slice`. Not sure if it is ok to change `slice` to use `Long`?