More powerful task decoding.

Also start file restructuring.