Fixed encoding
Added base.ts documentation, basic event system