Plugin rewrite

Refactors java and javascript code.
Implements watchWifiInfo to scan wifi
with automatic callbacks.