Change 'hunks' to 'active'
Change registers to hold defaultdicts, create helper function to return buffer_ids
Factor out Popen
Further refactor from akaptur