Added type information to applied styles calculation

The existing applied styles calculation returns an object structure with incomplete type information for Closure Compiler causing it to complain when trying to access parts of the returned object like the ordered styles collection.

To remedy this I have added some typedefs that describe the objects returned from the applied styles calculations. To add type annotations in a clean way I changed the structure of the object returned from the applied styles calculation.