Fixed System.read function

This is a re-implementation of the read function from bios.lua. Supports replacement characters, history, paste etc...