Incomplete fix/workaround for broadcast static type inference (#4673)

This changes the order of broadcast definitions function definitions to work around #4675. It also attempts to fix static type inference for the dimensionality of the returned array, although this only works for cases of sufficiently low dimensionality (`code_typed(.*, (Matrix{Float64}, Array{Float64, 8}))` works, but `code_typed(.*, (Matrix{Float64}, Array{Float64, 9}))` does not).

I'm not fully satisfied with this, but I'm putting it out there in case someone has an idea of how to make it more satisfactory.