A nonlocal beam theory for bending, buckling, and vibration of nanobeams