Fix Mantis bug #367.

library/array.m:
    When doing a binary search using a user-supplied comparison function,
    do not use the builtin term comparison operation to compare elements.

    Use separate loops for binary_search and approx_binary_search, since
    using the loop for approx_binary_search in the implementation of
    binary_search executes some unnecessary extra tests.

    Improve the documentation of both binary_search and approx_binary_search.

tests/general/array_binsearch.{m,exp}:
    Rewrite this test case to make it much tougher, testing the operation
    of binary_search and approx_binary_search with both the builtin and
    user-supplied comparison operations, and in the presence of repeated
    elements, and with automatic verification of the results.