Android: Added MainFragment. Lots of changes on how the fragments are managed by the main activity.

Related to issue #406.