Moved files. Some refactoring and cleanup.
Added pdf support.