Test for 'auto' in calculateElementWidth

Some older browsers will return 'auto' if no margin is specified,
rather than '0px'. This will cause parseInt to throw and error and
stop execution.
Per Mark's suggestion, a little refactoring
Merge pull request #4 from nathanstilwell/margin-auto-pull-request

Test for 'auto' in calculateElementWidth