Register subtypes and abstract flag of supertypes

* Fixes #4.
* Adds encoding information at the beginning of source code files