Redesign architecture

Making RBM and RSM as class.
Because current RBM implementation is not vectorized, I will  vectorize
this algorithm after I will implement RSM.