Use std::function for commands

While refactoring InputDispatcher to use unique_ptr in order to better
understand the lifespands of different object, it became necessary to
refactor commands into something more comprehensible.

Bug: 70668286
Test: presubmit
Change-Id: I273b4f75a32b2c4faf6f907de9f85e7323f2f90d
2 files changed