rbm bias updates properly, minor refactoring and bugfixes