That cap coming off is normal, no worries there. When you install it, that cap faces the front diff and gets pressed against it, so there is absolutely no chance of it coming loose once you've installed the axle on teh truck.
As for the grease, I'd be cleaning all that crap out and packing it with som fresh high temp stuff.
Who knows how long that stuff has been in there!