Cleaned up replacement code

Could possibly revert back to preg_match if we decide to do something like [[menu_dropdown: mainnav]] at some point.