Merging aya-soft master's first_in additions

plus a bit more.

Resolves #206