Add in PREFIX/etc/julia/juliarc.jl file for site-specific commands to be run at startup

Lays the groundwork for addressing #4222
Install platform-dependent juliarc files during `make dist` step
Add in juliarc.jl for OSX, remove environment setting in the Applescript launcher
change mimewritable to take instance rather than type
Infer element type for general multi-dimensional getindex
Infer return type for permutedims

This is the same kind of issue as #4387, but in this case we should
be able to statically infer the return type of the array (at least as
long as we don't care to make permutedims([1, 2], [2, 1]) work, but
this currently throws anyhow).

Unfortunately this revealed a bug in type inference, which emits
statically infers typeof(dimsB) for BitArrays and SubArrays as

(Type{TypeVar(:_,Vararg{Int})},)

which leads to the wrong similar method getting selected and inlined. I
changed inference.jl to infer this as (Int...) which works, but Vararg
types give me the creeps and I'm not sure this is a complete solution.
doc fix
Merge pull request #4393 from wlbksy/docfix

doc fix
Merge pull request #4375 from stevengj/mimewritable

RFC: change mimewritable to take instance rather than type
Merge pull request #4387 from simonster/getindex

Infer element type for general multi-dimensional getindex
Merge pull request #4388 from simonster/permutedims

Infer return type for permutedims
Merge pull request #4351 from JuliaLang/sf/juliarc

Add in PREFIX/etc/julia/juliarc.jl file for site-specific commands
Pkg: allow rm'ing unregistered packages; handle add errors better.

Note that this doesn't actually delete the package, but rather just
moves it into .trash – only if there is *already* something in there
by the same name does that pre-existing thing actually get removed.
Eliminate a debugging println that I missed
stat, et al.: don't allow stat predicates on raw unsigned integers.
Temp. disable BMI2 and AVX2 instructions for #4362

See #4362 for discussion, and this LLVM bug report:

http://llvm.org/bugs/show_bug.cgi?id=17422