Optimal Replacement and Inspection of Stochastically Failing Equipment