Change util.isEmulated to boolean and fix frontlight

Device:hasFrontlight always returned a true-like value because util.isEmulated was an integer.
Fixed this, also, used a polymorphic object design to reduce FrontLight code, and
adapted BaseFrontLight for the emulator.
Merge pull request #236 from thotypous/frontlight-fixes

Change util.isEmulated to boolean and fix frontlight