fixes #2685 incorrect and inefficient regexp checking medium name format

It takes eternity to compute something like this:

"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa  b" =~ /\A(\S+\s?)+\Z

Also "this is wrong " was not matched
fixes #2484 - host, hostgroup, and BMC passwords were overwritten as blank
fixes #2489 - fixes BMC password caused by rails bug accepts_nested_attributes_for and serialized child field
fixes #2686 - use setting model's string parser to update values
(cherry picked from commit 5d9073bba52b502b08b8b67b7f546eb4d481e5c1)
Fixes #2655 - Display Host buttons on unmanaged hosts if a puppet proxy exists
fixes #2317 - VM's with the name foreman_########