Support for commonjs exports

@kewisch Want to take?