Added abstraction layer and few tests.

Note: the graphics look stretched when tilting
the phone. Regardless the abstraction layer simplifies
the programming a lot. But needs more work and fine tuning.