util: Don't return empty tokens when splitting
dbbuilder: Reuse the split function

This simplifies the code quite a bit.