Motor libraries (and general updates)

Work-in-progress.