Add generic (un)pack.
Simplify RBM.
Merge branch 'master' into pack_unpack

Conflicts:
	src/RBM.cpp
Fix RBM test case.
Merge pull request #146 from AlexanderFabisch/pack_unpack

Pack/unpack