exceptions restructuring

make base exceptions abstract

use namespaces and packages for classes

try to fix cnn tests

try to fix cnn tests

try to fix cnn tests