Input validation with custom preferences

Fixes for [Issue 1578](https://code.google.com/p/ankidroid/issues/detail?id=1578) and [Issue 1662](https://code.google.com/p/ankidroid/issues/detail?id=1662).

I pulled the number range and steps validation code out of DeckOptions.java and created custom preferences that handle that work instead. That way we can use them in CramDeckOptions.java as well and in other places in the future. They can be configured in XML, so overall I think it's a much cleaner approach.

I added some simple exception handling in custom study input to fix Issue 1578, but nothing fancy.

The second commit is an auto-format on the XML.