Cleaned up code

Added some short tags and ternary operators; removed php closing tags at
the end of documents