Refactoring and code cleanup

Converting deckard to use AMD wrapper

Status: **Ready to merge**

Reviewers: @tedtate @johnboxall 
JIRA: https://mobify.atlassian.net/browse/CSOPS-766

## Changes
- converted to use AMD wrapper
- removed orientation-changing class. It's not guaranteed to be removed when the event is completed, therefore provides a bit of a buggy implementation
- added examples section
- refactored detect and orientation functions to separate concerns; added addClasses function to perform class adding
- simplified class toggling on orientation change to reduce reflows

## How to test-drive this PR
- checkout this branch
- `grunt test`
- integrate into a plugin, like lockup, and ensure it works
- `grunt serve` and use the examples page at http://localhost:3000/examples/index.html to verify deckard is correctly adding classes/properties. Use Chrome dev tools to toggle devices and refresh to verify updates are occurring correctly.

Actually, I guess there are pros to both approaches. It's useful to know
that named functions will show up in your tracebacks.

jb

On Wed, Nov 5, 2014 at 2:38 PM, Shawn Jansepar <notifications@github.com>
wrote:

> In dist/deckard.js:
>
> >
> > -        $html.removeClass('orientation-changing');
> > +    var addClasses = function(device, orientation) {
>
> @johnboxall <https://github.com/johnboxall> would be awesome to add this
> rule to the code style repo!
>
> https://github.com/mobify/mobify-code-style/
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/mobify/deckard/pull/4/files#r19912531>.
>



-- 

John Boxall, Chief Technology Officer

Powering Mobile Commerce Growth

 mobify.com <http://www.mobify.com/> | 1-866-502-5880 | M 778-882-0017

Get deep insights into mobile commerce strategy at Mobify Insights
<http://www.mobify.com/insights/>.