Reorganize /lib

Categorize source files and corresponding specs with aptly named directories.

dictionary.rb and layout.rb needed to be tweaked since they statically
reference directories as sources for dictionaries and layouts.