Fixed file saving (there seem to be some more problems with the serialization).
Fixed code format.
Complete rewrite (adapter support is now available and unit tests have been added).