m7: split extract script into extracter, makefile writer

Change-Id: I06a55d5d3b0f402ae693d6f28a8ea5f8cef207c3