extracted a new module for phonegap

Signed-off-by: Floyd Pink <imbleedingme@googlemail.com>