table: improve match and match! to use reflection