refactor(docs) use $window and add description for code directive

- This refactors to use <code>$window</code>, the Angular way instead  of using `window` Object. 
- Also adds documentation to the `code` directive. 

P.S. also signed Contributor License Agreement (CLA). 
there's no need for this comment block; this is not a public API