a much more elegant implementation of promote_type that fixes #3571
now I will have to rewrite that thesis section.
Merge branch 'master' of github.com:JuliaLang/julia