Fixes for GCC 4.7 algorithm and functional

Use of tests identified the following issues on GCC 4.7

- test for copy_n did not include algorithm header
- return types for function types required, in some cases, references

Add <algorithm> header to copy_n test.

Use references where needed in funtional binad and mem_fn tests.
Long term it may be best to use auto specifier here. Whilst we'd
like tests to be as orthogonal as possible, the functional types
are generally best used using auto!