Converted script to Perl, added color support

- Closes #1