port s3m loader to io layer
fix various bugs in mem buffer io implementation to make it usable :-)