Added BMH search algorithm.

Signed-off-by: Daniel Granlund <danne.granlund@gmail.com>