Initial package cleanups

Removes Swat dependency. Fixes some potential entity encoding errors. Fixes syntax errors.