Improve var names in get_memory

Backport from master
Use updated get_memory var names 

Backport to 2.1
#3174 Added handling of gateway groups in openvpn_restart
#3174 Handling of gateway groups in openvpn_restart()

If the underlying vip of a gateway group that an openvpn client is bound to is in backup mode then the client should not start.
Use hw.physmem when calculating pfsense_default_state_size

hw.physmem is the actual amount of memory that FreeBSD/pfSense can get its hands on, so use this for the calculation.
Backport to 2.1
Use new names for get_memory parameters
Use physmem and realmem from get_memory() in the appropriate places

Backport to 2.1
fix text
Resolves #3177. Do a filter reconfigure if the dynds ipsec hosts are present and being reloaded.
Make sure RRD data is restored from backup before upgrading data and a new backup is done after. It should fix #2159
Fix issue reported on http://forum.pfsense.org/index.php/topic,66160.0.html
Correct typo on variable name
Disable state killing on gateway failure by default for new configs.
Clarify the text describing the option while here.
Fix #3004:

. Create a function to replace strings on deep associative arrays
. Use the recent created function array_replace_values_recursive to fix
  VIP interface names instead of touch config.xml directly
Bring back static routes to fix issues reported on Ticext #3179
Merge pull request #794 from phil-davis/RELENG_2_1

Backport get_memory changes to 2.1
Merge pull request #790 from shahidsheikh/RELENG_2_1

 #3174 Added handling of gateway groups in openvpn_restart
Merge pull request #796 from phil-davis/master

Traffic Shaper GUI text typos
Increased needed memory for APC to 512M + code cleanup

- Increased the needed memory for APC to 512M as we often run into memory problems on our 256M box
- fixed the RAM calculation to divide by 1024 and not 1000
- code cleanup (renaming variables and creating new to avoid magic numbers)