More javadoc, some refactoring, fix reloading crash