Lots of tidying up

Moved terminal implementation to the generic TerminalApplication class,
fixed up copyrights, SA queries, docstrings, and so on. Moved all
package metadata into the main package, and updated the makefile