refactor. reorganized in classes. templates only in one file, no
templates in hpp.
some files were missing. Go nw..