Compatibility changes for Julia 0.4

Incorporated changes required for 0.4 compatibility. Using Compat.jl