Handling border cases and changing max_pages behaviour

Max_pages param now means window size to the left or right from the current page.

![index_html_](https://f.cloud.github.com/assets/487468/2245170/adf12fae-9d4b-11e3-84c1-5659d2da86c9.png)

Better handling of the border cases, not displaying "..." unless needed:

![index_html_-3](https://f.cloud.github.com/assets/487468/2245186/d8df37a6-9d4b-11e3-9803-bc43e9f27c9e.png)