Getting things working with -Wall and -Werror

o adding some function declarations
o getting rid of some unused variables
o bson_return_val_if_fail instead of bson_return_if_fail for non-void
  functions
Merge pull request #3 from hanumantmk/ha_test_fix

Getting things working with -Wall and -Werror