Micro- and nanoscale devices for high throughput and sensitive chemical analysis and production