On the Afterglow and Host Galaxy of GRB 021004: A Comprehensive Study with the Hubble Space Telescope