Untangling the spaghetti.

    Not quite enough brainpower to get the job done at the moment, saving
    my WIP point anyhow.
Add apache 2 license