Flux unit selector

This supersedes #23, since I don't have permission to add extra commits to that PR.