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.

Hopefully closes #20.