Performance increase and bug fix

Sometimes applescript will not throw errors when casting a record to
text (which allows the user to see the record as raw bytes), a
workaround is in place.
Some bugs occurred when reading strings with single quotes, this is
fixed by letting python read from the stdin
Lastly the performance of encoding records is increased because its no
longer needed to json encode the string representation. Also when
encoding a list with records we use the encodeRecords method to reduce
overhead of calling encodeRecords multiple times.