Move activity extraction to own file

Closes #28 and #29