Add Compat.jl dependency, remove 0.4 deprecation warnings

cc @IainNZ