Use new FmTerminal APIs provided by libfm. Also fix #31.