The tax treatment of dividends is changing but there are ways to limit the impact