First phone version

A lot sof refactoring, so all stuff is in PhoneLib now. And the whole
thing works on phone.