Added generic input reader. Fixes #3