Work In Progress

This commit is just to get the code to github, and ask for help. There
seem to be a problem with targets in _choose_target if I understand
things correctly.