Edited paper, especially main basis theorem. Mostly technical corrections