Reworked architecture of classes

fixed #1
closed #2
Added memory leaking control
Classes are not templated now