Unknown types

Handling unknown types, ignoring erbs, a lot more comments and some refactoring.