Major refactoring, see CHANGELOG and README.