Fixed bic computation
[FIX] Corrected gm.search

  Off by one in the main loop.
Removed unused counts parameter in trainAndScore
Correctly supported the case in which forward and backward are false
Small refactorings