Refactored the LevelEngine.js

Signed-off-by: Patrick Waivers <pwaivers@gmail.com>