cleaned up pages
moved "deviceready" listener into onload, like it is suggested
basic page detection