ip-mask: re-enable fall through optimization

Also change a fold to a for_all to allow for short-circuiting.