Move calculation of animation range into map.js

Also ensure animation state is reset if a layer is removed.
Fix JSLint errors
Fixed style

- Private functions should be on top (recommended by jslint and others
- Private methods should be created with this.foo as that makes them
public
Merge remote-tracking branch 'origin/154-fix-animation-2'

* origin/154-fix-animation-2:
  Fixed style
  Fix JSLint errors
  Move calculation of animation range into map.js