Big import cleanup. Also removes context.context.thread

I really hope that Travis accepts this.
Can haz context instead of context.context? :-D