Created and implemented the format class

large rewrite of the package structure.