added woff write support, some refactoring