WIP: refactoring kwiklib/spikedetekt2