(MCO-205) Fix call_agent_batched to work with active_record

MCollective monkey patches array to include #in_groups_of, unless the
method is already defined. In the case of using MCollective and
active_record this method is already defined.

MCollective's version of #in_groups_of can yield multiple results to the
block parameter. This is not the same behaviour as ActiveRecord's
implementation so when the method gets called using MCollective's
symantics #in_groups_of does not show the expected behaviour.

This commit is based on a recommendation by Fabian Ruff and changes the
invocation of #in_groups_of to match that of the method defined by
ActiveRecord.
Merge pull request #208 from ploubser/MCO-205

(MCO-205) Fix call_agent_batched to work with active_record
(docs) Reduce profile of unrelated tools
(docs) Adjust potentially dodgy Markdown formatting
Merge pull request #209 from nfagerlund/docs_formatting_jul18

Adjust Markdown formatting, reduce profile of unrelated tools
MCO-363 Extract normalize_facts from get_fact and make recursive

In dealing with structured facts we need to recursively transform all
non-string scalars to strings, while preserving the hashes and arrays.
MCO-363 Add structured matching semantics to has_fact?

Here we add simple structured fact support to the has_fact? utility
method.

In order to get there we extract the core matching into test_fact_value,
to allow for it to be applied to structured data compound data
structures more readily.  Then we add the semantics for matching
against structured values (any of the the contents of an Array or
keys of a Hash should match the test)
maint - add tests that ensure comparisons are numeric

With a string-wise comparison "100" > "2" yields false (because "1" > "2" is
false and you can shortcut out)

Here we add some additional testing to check that the automatic conversion did
work, and not that "1" > "2".

This should avoid reintroducing a regression that I caused in an earlier
iteration of implementing MCO-363.
MCO-363 Add a fact_data plugin

This plugin exposes the walking of structured facts to the compound query
language.

Some example usages:

   ./mco ping -S 'fact("roles.0").value=base'
   ./mco ping -S 'fact("system_uptime.days").value>10'

We split the parameter into path components on the '.', and then recursively
walk from the root facts down, by hash key or array index.

As a data plugin cannot return structured data directly, we may json encode the
value, and set the value_encoding property to 'application/json', otherwise it
will be 'text/plain' or, if a value is not found, the boolean false.
Merge pull request #210 from richardc/MCO-363_structured_facts

MCO-363 add support for structured facts
MCO-293 check for correct-looking base64

The default Base64.decode method is very accepting, and will ignore
any characters not of the base64 character set, and decode those
that it does handle.  This can lead to unfortunate error messages
in the case where the message was not base64 encoded to begin with,
but a connector may be configured to expect them, so it attempts
to decode what bits it can from a message body, yeilding something
that's just the base64-decodable portions of the input string, which
will typically choke a higher level deserialiser.

Here we reject any 'base64' messages that contain characters that
aren't in the base64 character set or whitespace, in order to raise
an error sooner.
Merge pull request #211 from richardc/MCO-293_base64_strictness

MCO-293 check for correct-looking base64
MCO-411 remove examples of catching RPCErrors in response blocks

It was originally intended that the appropriate exception for a
given rpc response would be propogated into the block supplied to
the call_agent method.  This isn't possible in ruby as noted in the
discussion around MCO-264.

Here we rework the misleading example code to reflect that we no
longer attempt to re-raise the exception in the supplied block, and
instead demonstrate testing response[:body][:statuscode].
MCO-351 Fix rabbitmq connector under custom discovery

If reply_to is set use it. In the case of using a custom discovery method,
the direct addressing method is used. In this case we want to keep the
reply_to if it is set by the command line.
Merge pull request #212 from richardc/MCO-411_docs_for_MCO-264

MCO-411 remove examples of catching RPCErrors in response blocks
(MCO-93) Introduce the ability to reset limit_targets

This commit adds the ability to RPC::Client#limit_targets= to reset
the @limit_targets instance variable by passing a nil or false value.
Merge pull request #214 from ploubser/mco-93

(MCO-93) Introduce the ability to reset limit_targets
Merge pull request #213 from richardc/finish_pr_198

MCO-351 Fix rabbitmq connector under custom discovery
maint - it's plugin.d, not plugins.d
MCO-416 specify the --daemonize option in init scripts

MCO-181 added the --daemonize and --no-daemonize options to mcollectived so
that the invoking init script could have final say about what it expects the
mcollectived to do - to daemonize or stay in the foreground - and so insulate
itself from a potential mismatch in the server.cfg and the expected behaviour.

Here we update the init scripts we have to make use of this feature.