A flexible lattice framework for valuing options on assets paying discrete dividends and variable annuities embedding GMWB riders