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

~~This changes the order of broadcast function definitions to work around #4675.~~ (No longer necessary since bfe8986c6a1c090d08d637460840abcf5c13f300). It also attempts to fix static type inference for the dimensionality of the returned array to fix #4673, 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; `code_typed(.*, (Matrix{Float64}, Matrix{Float64}, Matrix{Float64}))` works but `code_typed(.*, (Matrix{Float64}, Matrix{Float64}, Array{Float64, 3}))` 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.