Tidied up stocks code and continued work on next-train bookmarklet