ESSAYS ON FIRM DYNAMICS AND RESOURCE ALLOCATION