Initial auto-detection of input format (close #14)

Signed-off-by: Vlad Velici <vlad.velici@gmail.com>