buffer: add indexOf method

Adds a `.indexOf` method to `Buffer`, which borrows semantics from
both `Array.prototype.indexOf` and `String.prototype.indexOf`.

`Buffer.prototype.indexOf` can be invoked with a Buffer, a string
or a number as the needle.  If the needle a Buffer or string, it will
find the first occurrence of this sequence of bytes.  If the needle is
a number, it will find the first occurrence of this byte.

Reviewed-by: Sam Rijs <srijs@airpost.net>
Fixes: https://github.com/iojs/io.js/issues/95
PR-URL: https://github.com/iojs/io.js/pull/160
buffer: add lastIndexOf method

Expanding and reusing code by Sam Rijs in commit 4dedc09 to also add a
`.lastIndexOf` method to `Buffer`.

`Buffer.prototype.lastIndexOf` takes the same arguments as its
predecessor and uses a divide-and-conquer method to find the last
occurrence of the sequence of byte.

Reviewed-by: Martin Algesten <martin@algesten.se>
Related-To: https://github.com/iojs/io.js/issues/95
Original PR-URL: https://github.com/iojs/io.js/pull/160
PR-URL: https://github.com/iojs/io.js/pull/161