Cleaned up code, added textarea support, Fixes #2