Add magic "in-place" option. Add more unit tests for different output formats.

PS: I need more time to find problem with epub format. I'll do it later..