Initial Refractor

This commit focuses mostly on structure, and not much SQF code. Not
complete yet.