This is the approach I've taken to enabling segwit addresses for rpc calls on some bitcoin nodes I run.
-defaultwitnessaddress startup parameters has been added to return segwitaddresses by defaults
Witnessifier visitor has been moved to the top of the file for use in getaccountaddress/getnewaddress
getaccountaddress has been added the optional witness flag which will return Witnessified addresses
getnewaddress has been added the optional witness flag which will return Witnessified addresses
addwitnessaddress has been added an optional label parameter
Added check for witness used destination scripts in GetAccountPubkey
Change addresses default to P2SH wrapped segwit addresses when -defaultwitnessaddress is used