Add typedef support

Issue #5 and #19.