Move action classes under lib/

Splitting up the action logic from running the action itself (in the executable) helps organize the code a bit, and will make things easier for testing.