Merge pull request #271 from koreader/chrox-master

revert arbitary margin at the end line of italic text
First implementation of util.template()

The util.template function allows for better translations through
dynamic positioning of place markers. The range of place markers
runs from %1 to %99, but normally no more than two or three should
be required. There are no provisions for escaping place markers.

output = util.template{
    _("Hello %1, welcome to %2."),
    name,
    company
}

This function was inspired by Qt:
http://qt-project.org/doc/qt-4.8/internationalization.html#use-qstring-arg-for-dynamic-text
Added unit tests for util.template()
Merge pull request #272 from Frenzie/util.template

First implementation of util.template()
rework util.template() a bit
Merge pull request #273 from hwhw/master

rework util.template() a bit
refactor framebuffer implementation

no more auto-recognition. The user of the API is supposed to chose
the right implementation, i.e. do the device detection.

More fine-grained device-specific refresh implementation.

Simplification of the framebuffer API.
Integration (and thus complication :-)) of the Screen API into the
Framebuffer API.
only fix Kobo screen orientation when actually needed

The fix landscape -> portrait was done unconditionally. Do it only
when we actually are in landscape mode on startup.
debugging, fix bug in update/submission waiting

allow a debug function to be set

fix a bug (mangled variable names) in update/submissin waiting
fix rotation on rotated framebuffer on Kobos

forgot to update one settings store.
Yes, our rotation code is very convoluted.
Merge pull request #274 from hwhw/master

refactor framebuffer implementation
fix old framebuffer API usage in input_android

the Android input module triggers refreshes under certain circumstances.
This was not considered when refactoring the framebuffer API.
remove superfluous require()
add refreshUI() implementation

another refresh method
fix blitbuffer test

got broken when we changed default from 4bpp to 8bpp
Merge pull request #275 from hwhw/master

Fixes for refresh refactoring
do not handle Android app events/commands in timing critical section

we handled some events directly in the looper parsing section. This
led to funky behaviour: code was only executed in some parts (weird,
very, very weird behaviour). But we don't need to handle those events
there, since we pass the event on anyway. So it is some other part of
the application that is now in charge to handle the events.

The timing critical part (or what seems to be it, as the NDK documentation
does not say any special things about this code area) now only enqueues
the event for later processing.
Merge pull request #276 from hwhw/master

do not handle Android app events/commands in timing critical section
fix cannot login to Evernote